const { defineConfig } = require('@vue/cli-service');
const { name } = require('./package');

module.exports = defineConfig({
    transpileDependencies: true,
    publicPath: './',
    outputDir: "dist",
    lintOnSave: false,
    productionSourceMap: false,
    css: {
      loaderOptions: {
        // 向 CSS 相关的 loader 传递选项
        less: {
        
        }
      },
    },
    chainWebpack: config => {
      config.plugin('html').tap(args => {
        args[0].title = 'vdemo';
  
        return args;
      })
    },
    devServer: {
      headers: {
        'Access-Control-Allow-Origin': '*',
      },
    },
    configureWebpack: {
      output: {
        library: `${name}-[name]`,
        libraryTarget: 'umd', // 把微应用打包成 umd 库格式
        jsonpFunction: `webpackJsonp_${name}`, // webpack 5 需要把 jsonpFunction 替换成 chunkLoadingGlobal
      },
    },
})